package com.libgdxbar.pvzlikegame.entities;

import com.badlogic.gdx.utils.Array;

// 装饰器抽象类
public abstract class EntityDecorator extends BaseEntity {

	protected Array<BaseEntity> child;

	public EntityDecorator(BaseEntity... baseEntity) {
		this.child = new Array<>(baseEntity.length);
		for (BaseEntity entity : baseEntity) {
			this.child.add(entity);
		}
	}

	@Override
	public void run(float delta) {
		for (BaseEntity baseEntity : this.child) {
			baseEntity.run(delta);
		}
	}
}
